<template>
    <div @click="showChild = !showChild"> 逻辑复用 </div>
    <Child v-if="showChild" />
</template>

<script lang="ts">
import { defineComponent, ref } from 'vue'
import useMousePosition from '../utils/useMousePosition'
import Child from './13.LogicReuseChild.vue'

export default defineComponent({
    components: {
        Child
    },
    setup() {
        const { left, top } = useMousePosition()
        const showChild = ref(true)
        return {
            left,
            top,
            showChild
        }
    },
})
</script>
